package com.richpay.basejava.base08;

public class PassValueReferencesType {
    private int x;
    public static void main(String[] args){
        PassValueReferencesType passValue=new PassValueReferencesType();
        passValue.x=100;
        System.out.println("调用前passValue.x="+passValue.x);
        //引用数据类型参数传递传递的是引用地址
        passValue.change(passValue);
        System.out.println("调用后passValue.x="+passValue.x);
    }

    public void change(PassValueReferencesType pv){
        System.out.println("方法执行前 pv.x="+pv.x);
        pv.x=200;
        System.out.println("方法执行后 pv.x="+pv.x);
    }
}
